package io;

import java.io.*;
import java.nio.charset.StandardCharsets;

/**
 * 转换流： InputStreamReader  OutputStreamReader
 * 继承自Reader和Writer
 */
public class OSWDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("osw.txt");
        //创建字符转换流，并明确字符集
        OutputStreamWriter osw=new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        osw.write("I've traveled the world ");
        osw.write("and seven seas ");
        System.out.println("Finished!");
        osw.close();
    }
}
